<template>
	<el-table ref="tableDom" :data="data" border stripe size="small">
		<el-table-column label="序号" :type="type" fixed="left" width="60" align="center"></el-table-column>
		<el-table-column label="学生姓名" fixed="left" prop="name" width="100"></el-table-column>
		<el-table-column label="意向度" width="150">
			<template #="{ row }">
				<el-rate disabled v-model="row.purpose"></el-rate>
			</template>
		</el-table-column>
		<el-table-column label="联系电话" prop="mobile" width="100"></el-table-column>
		<el-table-column label="微信" prop="wechat" width=""></el-table-column>
		<el-table-column label="维护人" prop="whrName" width=""></el-table-column>
		<el-table-column label="性别" width="">
			<template #="{ row }">
				{{ dicts.system_global_gender.find(item => item.v === row.level)?.k }}
			</template>
		</el-table-column>
		<el-table-column label="跟进时间" width="150">
			<template #="{ row }">
				{{ tool.dateFormat(row.followTime, 'yyyy-MM-dd hh:mm:ss') }}
			</template>
		</el-table-column>
		<el-table-column label="下次跟进时间" width="150">
			<template #="{ row }">
				{{ tool.dateFormat(row.followNextTime, 'yyyy-MM-dd hh:mm:ss') }}
			</template>
		</el-table-column>
		<el-table-column label="跟进内容" prop="followContent" width="200"></el-table-column>
		<el-table-column label="领取人" prop="collectName" width=""></el-table-column>
		<el-table-column label="领取时间" width="150">
			<template #="{ row }">
				{{ tool.dateFormat(row.collectTime) }}
			</template>
		</el-table-column>
		<el-table-column label="学历" prop="education" width="100">
			<template #="{ row }">
				{{ dicts.recruit_education_background.find(item => item.v === row.education)?.k }}
			</template>
		</el-table-column>
		<el-table-column label="重要级别" width="100">
			<template #="{ row }">
				{{ dicts.recruit_customer_level.find(item => item.v === row.level)?.k }}
			</template>
		</el-table-column>
		<el-table-column label="所在区域" width="180">
			<template #="{ row }">
				{{ `${row.provinceName}-${row.cityName}-${row.countyName}` }}
			</template>
		</el-table-column>
		<el-table-column label="渠道" prop="channelName" width=""></el-table-column>
		<el-table-column label="成交状态" prop="dealStatus" width="100">
			<template #="{ row }">
				{{ dicts.recruit_dealStatus.find(item => item.v == row.dealStatus)?.k }}
			</template>
		</el-table-column>
		<el-table-column label="操作" fixed="right" width="120">
			<template #="{ row }">
				<slot :row="row"></slot>
			</template>
		</el-table-column>
	</el-table>
	<XlxPagination v-model:currentPage="currentPage" v-model:pageSize="pageSize" :total="totals"
		@update:currentPage="emits('getData')" @update:pageSize="updateSize">
	</XlxPagination>
</template>

<script setup lang="ts">
import { useDicts } from '@renderer/composables/dicts';
import { RecruitItem } from '@renderer/interface/recruit';
import { tool } from '@renderer/utils/tool';

defineProps<{
	data: RecruitItem[]
	totals: number
	type: string
}>()
const emits = defineEmits(['getData'])
const currentPage = defineModel('currentPage')
const pageSize = defineModel('pageSize')
const tableDom = defineModel('tableDom')
const { dicts } = useDicts(['recruit_education_background', 'recruit_customer_level', 'system_global_gender', 'recruit_dealStatus'])

const updateSize = () => {
	currentPage.value = 1
	emits('getData')
}

</script>

<style scoped></style>